<template>
	<view class="conbox designs">
		<view class="main_content">
			<view class="free pubimg">
				<image :src="`${imgUrl}design/freemodule/icon_calcular.png`" alt></image>
			</view>
			<v-puboffer ref="formtable" :mobile="mobile" :ownerUserId="owner_user_id"></v-puboffer>
			<view class="bill pubimg">
				<image v-if="constant.oemSource == 3" :src="`${imgUrl}design/freemodule/icon_pricebill_wj.png`" alt></image>
				<image v-else :src="`${imgUrl}design/freemodule/icon_pricebill.png`" alt></image>
			</view>
			<view class="about pubimg">
				<image v-if="constant.oemSource == 3" :src="`${imgUrl}design/freemodule/icon_about_wj.png`" alt></image>
				<image v-else :src="`${imgUrl}design/freemodule/icon_about.jpg`" alt></image>
			</view>
		</view>
	</view>
</template>

<script>
import { mapGetters, mapState, mapActions } from 'vuex'
import puboffer from '@/pages/components/puboffer'
import { getBasicUser } from '@/utils/auth'

export default {
	name: 'Inteoffer',
	components: {
		'v-puboffer': puboffer
	},
	data() {
		return {
			imgUrl: this.$constant.imgUrl,
			mobile: '',
			constant: this.$constant,
			owner_user_id: ''
		}
	},
	computed: {
		...mapGetters({ userInfo: 'getBasicUser' })
	},
	onLoad(option) {
		const { mobile, owner_user_id } = option
		if (mobile) {
			this.mobile = mobile
		} else {
			const wxMobile = uni.getStorageSync('wxMobile') || ''
			this.mobile = option.mobile ? option.mobile : wxMobile
		}
		if (owner_user_id) {
			this.owner_user_id = owner_user_id
			getBasicUser(this.owner_user_id).then(res => {

			})
		}
	},
	/**
     * 用户点击右上角分享
     */
	onShareAppMessage: function(options) {
		const shareObj = {
			title: '5秒免费获取你家的装修报价，快戳进来算一下吧【' + this.userInfo.nick_name + '】',
			path: `/pages/pagesHome/thematicmo/inteoffer?owner_user_id=${this.userInfo.user_id}`
		}
		return shareObj
	}
}
</script>

<style scoped lang="scss">
	.designs {
		background: #f5f5f5;
	}

	.main_content {
		width: 100%;
		height: auto;
		padding-bottom: 140px;
	}

	body {
		background-image: none !important;
		background: white;
	}

	.titlename {
		margin-left: 0;
	}

	.free {
		width: 100%;
		height: 409px;
	}

	.free image {
		width: 100%;
	}

	.bill {
		width: 100%;
		height: 440px;
	}

	.pubimg image {
		width: 100%;
		height: 100%;
	}

	.about {
		width: 100%;
		height: 240px;
	}
</style>
